package com.fay.mymiaosha.controller;

import com.fay.mymiaosha.dao.UserDoMapper;
import com.fay.mymiaosha.dataobject.UserDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/14 21:48
 * @Version 1.0
 */

@RestController
public class HomeController extends BaseController {

    @Autowired
    private UserDoMapper userDoMapper;

    @GetMapping("/")
    public String home() {
        UserDo userDo = userDoMapper.selectByPrimaryKey(1);
        if (userDo == null) {
            return "not exist";
        } else {
            return userDo.getName();
        }
    }
}
